//
//  WidnowVisible.swift
//  BasicTools
//
//  Created by ikang on 2025/7/16.
//

import Foundation

#if os(macOS)
import AppKit

// 判断window是否存在在桌面
public func WidnowVisible(_ windowTitle: String) -> Bool {
    var isVisible: Bool = false
    NSApp.windows.forEach { window in
        if window.title == windowTitle, window.isVisible {
            isVisible = true
        }
    }
    
    return isVisible
}
#endif
